package com.google.code.b0rx0r.program;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class SnappointView implements Iterable<SnapPoint> {
	Set<SnapPoint> sps = new HashSet<SnapPoint>();
	
	public SnappointView(Sequencable seq, Iterator<SnapPoint> base, int start, int end) {
		while(base.hasNext()) {
			SnapPoint sp = base.next();
			if (sp.getOffset() >= start && sp.getOffset() <= end) {
				sps.add(new AbsoluteSnapPoint(seq, sp.getOffset() - start));
			}
		}
	}


	@Override
	public Iterator<SnapPoint> iterator() {
		return sps.iterator();
	}
	


}
